<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <div th:replace="~{/home::css_js}"></div>
</head>
<body>
<div id="wrapper">

    <div th:replace="~{/home::topbar}"></div>

    <div th:replace="~{/home::sidebar}"></div>

    <div class="main">
        <!-- MAIN CONTENT -->


        <div class="main-content">
            <div class="container-fluid">
                <div id="page-wrapper">
                    <div id="page-inner">
                        <div class="row">
                            <div class="col-md-12">
                                <h1 class="page-header">
                                    修改商品订单
                                </h1>
                            </div>
                            <div class="row">
                                <div class="col-lg-12"> <!--把col lg 12宽 分成了 左边6 右边6-->
                                    <div class="panel panel-default">
                                        <div class="panel-heading"> <!--panel顶部一整行-->
                                            正在修改订单 [[${buy_list.getBuy_list_id()}]]
                                        </div>
                                        <div class="panel-body">
                                            <div class="row">         <!--form 表单的开始-->
                                                <div class="col-lg-11">          <!--thymeleaf页面要绑定所有的url，否则报403-->
                                                    <form role="form" th:action="@{/buy_list/modify_buy_list_do}" method="post">
                                                        <input th:type="hidden" th:value="${buy_list.getBuy_list_id()}" name="buy_list_id">
                                                        <input th:type="hidden" th:value="${buy_list.getUsername()}" name="username">
                                                        <input th:type="hidden" th:value="${buy_list.getList_time()}" name="list_time">

                                                        <div class="form-group">
                                                            <!--发现，form中的组件都被<div class="form-group"></div>包住了-->
                                                            <label>修改商品</label>
                                                            <select class="form-control" th:name="goods_id" size="1">
                                                                <option th:each="goods:${goodsList}" th:value="${goods.getGoods_id()}" th:text="${goods.getName()+'('+goods.getGoods_id()+')'}"
                                                                        th:required="required" th:selected="${goods.getGoods_id()==buy_list.getGoods_id()?true:false}"></option>
                                                            </select>
                                                        </div>

                                                        <div class="form-group">
                                                            <label>购买数量</label>
                                                            <input class="form-control" th:type="text" name="num" th:value="${buy_list.getNum()}">
                                                        </div>
                                                        <div class="form-group">
                                                            <label>商品售价</label>
                                                            <input class="form-control" th:type="text" name="price_out" th:value="${buy_list.getPrice_out()}">
                                                        </div>
                                                        <div class="form-group">
                                                            <label>应付金额</label>
                                                            <input class="form-control" th:type="text" name="money" th:value="${buy_list.getMoney()}">
                                                        </div>
                                                        <div class="form-group">
                                                            <label>买家电话</label>
                                                            <input class="form-control" th:type="text" name="phone" th:value="${buy_list.getPhone()}">
                                                        </div>
                                                        <div class="form-group">
                                                            <label>送货地址</label>
                                                            <input class="form-control" th:type="text" name="address" th:value="${buy_list.getAddress()}">
                                                        </div>
                                                        <div class="form-group">
                                                            <label>订单状态</label>
                                                            <input name="state" th:type="radio" value="0" th:checked="${buy_list.getState()==0?true:false}">未付款&emsp;
                                                            <input name="state" th:type="radio" value="1" th:checked="${buy_list.getState()==1?true:false}">已付款&emsp;
                                                            <input name="state" th:type="radio" value="2" th:checked="${buy_list.getState()==2?true:false}">未处理
                                                        </div>

                                                        <button type="submit" class="btn btn-success">提交</button>
                                                        <a class="btn btn-primary" th:href="@{/buy_list/buy_list_show}">取消</a>
                                                    </form>
                                                    <!--form表单结束-->
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
</body>
</html>